#!/bin/sh

. libtest.sh
. libgit.sh

export WIDTH=40
export LINES=18

tigrc <<EOF
set vertical-split = auto
EOF

steps '
	:enter
	:save-display main-vsplit-default.screen

	:toggle split-view-width +25%
	:save-display main-vsplit-25-75.screen

	:set vertical-split = no
	:save-display main-hsplit-default.screen

	:toggle split-view-height -17%
	:save-display main-hsplit-50-50.screen
'

git_clone 'repo-one'

test_tig

assert_equals 'main-vsplit-default.screen' <<EOF
2010-04-07 05:37 +0000 Max Power        |commit 5cb3412a5e06e506840495b91acc8850
2010-03-29 17:15 +0000 Jørgen Thygesen B|Refs: [master], {origin/master}, {origi
2010-03-21 04:53 +0000 作者             |Author:     Max Power <power123@example
2010-03-12 16:31 +0000 René Lévesque    |AuthorDate: Wed Apr 7 05:37:40 2010 +00
2010-03-04 04:09 +0000 A. U. Thor       |Commit:     Committer <c.ommitter@examp
2010-02-23 15:46 +0000 Max Power        |CommitDate: Wed Apr 7 05:37:40 2010 +00
2010-02-15 03:24 +0000 Jørgen Thygesen B|
2010-02-06 15:02 +0000 作者             |    Commit 10 E
2010-01-29 02:40 +0000 René Lévesque    |
2010-01-20 14:18 +0000 A. U. Thor       |
2010-01-12 01:56 +0000 Max Power        |
2010-01-03 13:33 +0000 Jørgen Thygesen B|
2009-12-26 01:11 +0000 作者             |
2009-12-17 12:49 +0000 René Lévesque    |
2009-12-09 00:27 +0000 A. U. Thor       |
2009-11-30 12:05 +0000 Max Power        |
[main] 5cb3412a5e06e506840495b91acc8 32%|[diff] 5cb3412a5e06e506840495b91ac 100%
EOF

assert_equals 'main-vsplit-25-75.screen' <<EOF
2010-04-07 05:37 +0 |commit 5cb3412a5e06e506840495b91acc885037a48b72
2010-03-29 17:15 +0 |Refs: [master], {origin/master}, {origin/HEAD}, v1.0-13-g5c
2010-03-21 04:53 +0 |Author:     Max Power <power123@example.org>
2010-03-12 16:31 +0 |AuthorDate: Wed Apr 7 05:37:40 2010 +0000
2010-03-04 04:09 +0 |Commit:     Committer <c.ommitter@example.net>
2010-02-23 15:46 +0 |CommitDate: Wed Apr 7 05:37:40 2010 +0000
2010-02-15 03:24 +0 |
2010-02-06 15:02 +0 |    Commit 10 E
2010-01-29 02:40 +0 |
2010-01-20 14:18 +0 |
2010-01-12 01:56 +0 |
2010-01-03 13:33 +0 |
2009-12-26 01:11 +0 |
2009-12-17 12:49 +0 |
2009-12-09 00:27 +0 |
2009-11-30 12:05 +0 |
[main] 5cb3412a5 32%|[diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 100%
EOF

assert_equals 'main-hsplit-default.screen' <<EOF
2010-04-07 05:37 +0000 Max Power             o [master] {origin/master} {origin/
2010-03-29 17:15 +0000 Jørgen Thygesen Brahe o Commit 10 D
2010-03-21 04:53 +0000 作者                  o Commit 10 C
2010-03-12 16:31 +0000 René Lévesque         o Commit 10 B
2010-03-04 04:09 +0000 A. U. Thor            o Commit 10 A
[main] 5cb3412a5e06e506840495b91acc885037a48b72 - commit 1 of 50             10%
commit 5cb3412a5e06e506840495b91acc885037a48b72
Refs: [master], {origin/master}, {origin/HEAD}, v1.0-13-g5cb3412
Author:     Max Power <power123@example.org>
AuthorDate: Wed Apr 7 05:37:40 2010 +0000
Commit:     Committer <c.ommitter@example.net>
CommitDate: Wed Apr 7 05:37:40 2010 +0000
 
    Commit 10 E
 
 
[diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 8               100%
EOF

assert_equals 'main-hsplit-50-50.screen' <<EOF
2010-04-07 05:37 +0000 Max Power             o [master] {origin/master} {origin/
2010-03-29 17:15 +0000 Jørgen Thygesen Brahe o Commit 10 D
2010-03-21 04:53 +0000 作者                  o Commit 10 C
2010-03-12 16:31 +0000 René Lévesque         o Commit 10 B
2010-03-04 04:09 +0000 A. U. Thor            o Commit 10 A
2010-02-23 15:46 +0000 Max Power             o Commit 9 E
2010-02-15 03:24 +0000 Jørgen Thygesen Brahe o Commit 9 D
2010-02-06 15:02 +0000 作者                  o Commit 9 C
[main] 5cb3412a5e06e506840495b91acc885037a48b72 - commit 1 of 50             16%
commit 5cb3412a5e06e506840495b91acc885037a48b72
Refs: [master], {origin/master}, {origin/HEAD}, v1.0-13-g5cb3412
Author:     Max Power <power123@example.org>
AuthorDate: Wed Apr 7 05:37:40 2010 +0000
Commit:     Committer <c.ommitter@example.net>
CommitDate: Wed Apr 7 05:37:40 2010 +0000
 
[diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 8                87%
EOF
